package org.jspar.partition;

import org.jspar.Options;

/**
 * VARIANT 3:  A partition is acceptable if the parent represents 
 * an increace in the total number of connections represented by the 
 * branch.  (So a good partition will represent a local maxima)
 */
public class SlopeBasedRule extends PartitionRule {

	public SlopeBasedRule(Options options) {
		super(options);
	}

	public boolean isAcceptable(Cluster ci, Cluster cj, int c) {
		int l = ci.connections();
		int r = cj.connections();
		int max = l > r ? l : r;

		return c >= max && c <= configuration.maxPartitionConn;
	}
}
